﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.YG
{
    /// <summary>
    /// 阳光人寿鸿福齐添年金保险（分红型）
    /// </summary>
    class Class8
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ppa"></param>
        /// <param name="da"></param>
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故"))
            {
                double s = ppa.GetDutyTotalValue("个人账户") * 1.05;

                da.Value = s > ppa.Amount ? s : ppa.Amount;
                ppa.IsCurrentFinish = true;
                da.Description = "个人账户与保额取较大者";
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Period >= 3 && ppa.Period % 3 == 0)
            {

                IDutyActing da1 = ppa.DutyActings.FirstOrDefault(p => p.Duty.Name == "个人账户");

                da1.Value += ppa.Fee * 0.02;

                da.Description = "持续交费特别奖金已经计入个人账户";
            }
        }
    }
}
